<div class="boxed">

    <!--CONTENT CONTAINER-->
    <!--===================================================-->
    <div id="content-container">

        <!--Page Title-->
        <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
        <div id="page-title">

        </div>
        <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
        <!--End page title-->


        <!--Breadcrumb-->
        <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
        <ol class="breadcrumb">
            <li><a href="{:url('Admin/Index/index')}">首页</a></li>
            <li><a href="#">系统设置</a></li>
            <li class="active">文章管理</li>
        </ol>
        <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
        <!--End breadcrumb-->
        <div class="panel">
            <!-- <div class="panel-heading">
                <h3 class="panel-title">Sample Toolbar</h3>
            </div> -->

            <!--Data Table-->
            <!--===================================================-->
            <div class="panel-heading">
                <h3 class="panel-title">
                    <a class="btn btn-info btn-rounded" href="{:url('Admin/Article/add_art')}">
                        新增文章
                    </a>
                </h3>
            </div>
            <div class="panel panel-info">
                <div class="panel-body">
                    <table  class="table table-bordered table-hover">
                        <thead>
                        <tr>
                            <th width="5%">ID</th>
                            <th width="15%">标题</th>
                            <th width="30%">摘要</th>
                            <th width="15%">时间</th>
                            <th width="10%">作者</th>
                            <th width="25%">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {volist name = "data" id = "vo" }
                        <tr>
                            <td>{$vo.article_id}</td>
                            <td>{$vo.art_title}</td>
                            <td>{$vo.art_desc}</td>
                            <td>{$vo.art_time}</td>
                            <td>{$vo.user_nickname}</td>
                            <td>
                                <a type="button"
                                   class="btn btn-warning  btn-xs btn-rounded"
                                   href="{:url('Admin/Article/edi_art',array('id'=>$vo['article_id']))}">  编辑  </a>
                                &nbsp;&nbsp;
                                <a  type="button" class="btn btn-danger  btn-xs btn-rounded"  href="javascript:if(confirm('确认删除这篇文章？'))location='{:url('Admin/Article/del_art',array('id'=>$vo['article_id']))}'">  删除  </a>
                            </td>
                        </tr>
                        {/volist}
                        </tbody>
                    </table>

                    {$data->render()}
                </div>
            </div>
            <!--===================================================-->
            <!--End Data Table-->

        </div>
    </div>
    <!--===================================================-->
    <!--END CONTENT CONTAINER-->



    <!--ASIDE-->
    <!--===================================================-->
    <!--===================================================-->
    <!--END ASIDE-->



</div>
<!-- 添加菜单模态框开始 -->
<div class="modal fade" id="thinkright-add" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    新增角色
                </h4>
            </div>
            <div class="modal-body">
                <form class="form-inline" action="{:url('Admin/Rule/add_group')}" method="post">
                    <div class="form-group">
                        <label for="demo-inline-inputmail" class="sr-only">角色名：</label>
                        <input type="text" placeholder="请输入角色"  id="demo-inline-inputmail" class="form-control" name="title">
                    </div>
                    <button class="btn btn-primary" type="submit">添加</button>
                </form>

            </div>
        </div>
    </div>
</div>
<!-- 添加菜单模态框结束 -->

<!-- 修改菜单模态框开始 -->
<div class="modal fade" id="thinkright-edit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    修改规则
                </h4>
            </div>
            <div class="modal-body">
                <form id="bjy-form" class="form-inline" action="{:url('Admin/Rule/edit_group')}" method="post">
                    <input type="hidden" name="id">
                    <table class="table table-striped table-bordered table-hover table-condensed">
                        <tr>
                            <th width="12%">规则名：</th>
                            <td>
                                <input class="form-control" type="text" name="title">
                            </td>
                        </tr>
                        <tr>
                            <th></th>
                            <td>
                                <input class="btn btn-success" type="submit" value="修改">
                            </td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
    </div>
</div>
<!-- 修改菜单模态框结束 -->

<!-- 给角色添加用户开始 -->
<div class="modal fade" id="thinkright-adduser" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    添加成员
                </h4>
            </div>
            <div class="modal-body">
                <form class="form-inline" action="{:url('Admin/Rule/add_user')}" method="post">
                    <div class="form-group">
                        <label for="demo-inline-inputmail" class="sr-only">成员名：</label>
                        <input type="text" placeholder="请输入角色的成员"  id="demo-inline-inputmail" class="form-control" name="title">
                        <input type="hidden" name="group_id">
                    </div>
                    <button class="btn btn-primary" type="submit">添加</button>
                </form>

            </div>
        </div>
    </div>
</div>
<!-- 给角色添加用户结束 -->


<script>
    // 添加菜单
    function add(){
        $("input[name='title']").val('');
        $('#thinkright-add').modal('show');
    }

    // 修改菜单
    function edit(obj){
        var ruleId=$(obj).attr('ruleId');
        var ruletitle=$(obj).attr('ruletitle');
        $("input[name='id']").val(ruleId);
        $("input[name='title']").val(ruletitle);
        $('#thinkright-edit').modal('show');
    }

    // 向角色添加用户 Admin/Rule/check_user
    function adduser(obj){
        var groupId=$(obj).attr('groupId');
        // var ruletitle=$(obj).attr('ruletitle');
        $("input[name='group_id']").val(groupId);
        // $("input[name='title']").val(ruletitle);
        $('#thinkright-adduser').modal('show');
    }
</script>
